<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::RGB565 Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="struct_sifteo_1_1_r_g_b565-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::RGB565 Struct Reference<div class="ingroups"><a class="el" href="group__video.html">Video</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Represents a 16-bit 5:6:5 color, the native format used by our display.  
 <a href="struct_sifteo_1_1_r_g_b565.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="color_8h_source.html">sifteo/video/color.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5785cfa9dc98d437a94e3a61c6d6c17f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5785cfa9dc98d437a94e3a61c6d6c17f"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a5785cfa9dc98d437a94e3a61c6d6c17f">blue</a> () const </td></tr>
<tr class="memdesc:a5785cfa9dc98d437a94e3a61c6d6c17f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's blue component, extended to 8 bits. <br/></td></tr>
<tr class="separator:a5785cfa9dc98d437a94e3a61c6d6c17f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab15a795fe7fb6018492ffed77c718616"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab15a795fe7fb6018492ffed77c718616"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616">blue5</a> () const </td></tr>
<tr class="memdesc:ab15a795fe7fb6018492ffed77c718616"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's blue component, as a 5-bit value. <br/></td></tr>
<tr class="separator:ab15a795fe7fb6018492ffed77c718616"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a398146a00d4efe894a727b08da14dd07"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a398146a00d4efe894a727b08da14dd07"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a398146a00d4efe894a727b08da14dd07">green</a> () const </td></tr>
<tr class="memdesc:a398146a00d4efe894a727b08da14dd07"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's green component, extended to 8 bits. <br/></td></tr>
<tr class="separator:a398146a00d4efe894a727b08da14dd07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aded38b2824696652e9af786deecc673c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aded38b2824696652e9af786deecc673c"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c">green6</a> () const </td></tr>
<tr class="memdesc:aded38b2824696652e9af786deecc673c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's green component, as a 6-bit value. <br/></td></tr>
<tr class="separator:aded38b2824696652e9af786deecc673c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a900c52657df0fc33b53c2329287de642"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a900c52657df0fc33b53c2329287de642">lerp</a> (<a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> other, uint8_t alpha) const </td></tr>
<tr class="memdesc:a900c52657df0fc33b53c2329287de642"><td class="mdescLeft">&#160;</td><td class="mdescRight">Linear interpolation between this color and another color.  <a href="#a900c52657df0fc33b53c2329287de642">More...</a><br/></td></tr>
<tr class="separator:a900c52657df0fc33b53c2329287de642"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80c0c9d0ae95fa9aa15a0bd9c5855b73"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a80c0c9d0ae95fa9aa15a0bd9c5855b73"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a80c0c9d0ae95fa9aa15a0bd9c5855b73">operator!=</a> (const <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> &amp;other) const </td></tr>
<tr class="memdesc:a80c0c9d0ae95fa9aa15a0bd9c5855b73"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exact inequality test. <br/></td></tr>
<tr class="separator:a80c0c9d0ae95fa9aa15a0bd9c5855b73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c51313d6e99caf15698e7733c777cc9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c51313d6e99caf15698e7733c777cc9"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a5c51313d6e99caf15698e7733c777cc9">operator==</a> (const <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> &amp;other) const </td></tr>
<tr class="memdesc:a5c51313d6e99caf15698e7733c777cc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exact equality test. <br/></td></tr>
<tr class="separator:a5c51313d6e99caf15698e7733c777cc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a452d19f7e4a053994e4cb0f1f88b49f5"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a452d19f7e4a053994e4cb0f1f88b49f5">packedRGB</a> () const </td></tr>
<tr class="memdesc:a452d19f7e4a053994e4cb0f1f88b49f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color as a packed 24-bit RGB value.  <a href="#a452d19f7e4a053994e4cb0f1f88b49f5">More...</a><br/></td></tr>
<tr class="separator:a452d19f7e4a053994e4cb0f1f88b49f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acae33d5b3e9e12e5e3eacbe9855be163"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acae33d5b3e9e12e5e3eacbe9855be163"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#acae33d5b3e9e12e5e3eacbe9855be163">red</a> () const </td></tr>
<tr class="memdesc:acae33d5b3e9e12e5e3eacbe9855be163"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's red component, extended to 8 bits. <br/></td></tr>
<tr class="separator:acae33d5b3e9e12e5e3eacbe9855be163"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4f2bf1537970663216f288a7ee5f869"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4f2bf1537970663216f288a7ee5f869"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869">red5</a> () const </td></tr>
<tr class="memdesc:aa4f2bf1537970663216f288a7ee5f869"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the color's red component, as a 5-bit value. <br/></td></tr>
<tr class="separator:aa4f2bf1537970663216f288a7ee5f869"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ac537f5470df2f336f298289d1e6b1ed7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac537f5470df2f336f298289d1e6b1ed7"></a>
static <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7">from565</a> (uint8_t r, uint8_t g, uint8_t b)</td></tr>
<tr class="memdesc:ac537f5470df2f336f298289d1e6b1ed7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color from a 5-6-5-bit RGB color, with each component specified separately. <br/></td></tr>
<tr class="separator:ac537f5470df2f336f298289d1e6b1ed7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a729d621f56b7a610e864caf180778aff"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a729d621f56b7a610e864caf180778aff"></a>
static <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff">fromRGB</a> (uint8_t r, uint8_t g, uint8_t b)</td></tr>
<tr class="memdesc:a729d621f56b7a610e864caf180778aff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color from an 8-bit RGB color. We accurately round to the nearest representable 16-bit color. <br/></td></tr>
<tr class="separator:a729d621f56b7a610e864caf180778aff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e53b6315b19e464ac9622291aaa849e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e53b6315b19e464ac9622291aaa849e"></a>
static <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#a6e53b6315b19e464ac9622291aaa849e">fromRGB</a> (float r, float g, float b)</td></tr>
<tr class="memdesc:a6e53b6315b19e464ac9622291aaa849e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color from a floating point RGB color. We accurately round to the nearest representable 16-bit color. <br/></td></tr>
<tr class="separator:a6e53b6315b19e464ac9622291aaa849e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecefb503f12bb4a3fef22cfb9d135616"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#aecefb503f12bb4a3fef22cfb9d135616">fromRGB</a> (uint32_t rgb)</td></tr>
<tr class="memdesc:aecefb503f12bb4a3fef22cfb9d135616"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color from a packed-pixel 24-bit RGB color.  <a href="#aecefb503f12bb4a3fef22cfb9d135616">More...</a><br/></td></tr>
<tr class="separator:aecefb503f12bb4a3fef22cfb9d135616"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:aab28724ae443519720a500a30bc06e34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab28724ae443519720a500a30bc06e34"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34">value</a></td></tr>
<tr class="memdesc:aab28724ae443519720a500a30bc06e34"><td class="mdescLeft">&#160;</td><td class="mdescRight">The raw color value, as a 16-bit integer. <br/></td></tr>
<tr class="separator:aab28724ae443519720a500a30bc06e34"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a 16-bit 5:6:5 color, the native format used by our display. </p>
<p>This is a C++ Plain Old Data (POD) type.</p>
<p><a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> colors can be converted to and from 8-bit RGB, and this class can perform simple color blending. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aecefb503f12bb4a3fef22cfb9d135616"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> Sifteo::RGB565::fromRGB </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>rgb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create an <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color from a packed-pixel 24-bit RGB color. </p>
<p>Blue is in the least significant byte, making this convenient for specifying colors in the common hexadecimal format 0xRRGGBB. </p>

</div>
</div>
<a class="anchor" id="a900c52657df0fc33b53c2329287de642"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> Sifteo::RGB565::lerp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td>
          <td class="paramname"><em>other</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>alpha</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Linear interpolation between this color and another color. </p>
<p>When alpha=255, this returns the "other" color. When alpha=0, we return this color. Values in-between will result in a correspondingly blended color. </p>

</div>
</div>
<a class="anchor" id="a452d19f7e4a053994e4cb0f1f88b49f5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Sifteo::RGB565::packedRGB </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the color as a packed 24-bit RGB value. </p>
<p>Blue is in the least significant byte. The resulting color, in hexadecimal, has the form 0xRRGGBB. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="color_8h_source.html">color.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
